#include <stdio.h>
int gcd(int m, int n);
int main(void)
{
    int m, n;
    printf("Enter two integers: ");
    scanf("%d %d", &m, &n);
    printf("Greatest common divisor: %d\n", gcd(m, n));
    return 0;
}
int gcd(int m, int n) {
    if (m < n) {
        m = m + n;
        n = m - n;
        m = m - n;
    }
    while (n != 0) {
        m = m % n;
        m = m + n;
        n = m - n;
        m = m - n;
    }
    return m;
}